//#include <stdio.h>

#include <math.h>
#include "menu.h"
#include "user.h"
#include "message.h"
#include "chain.h"
#include <conio.h>

double besj(double arg){



//********** 1 order Bessel-function of the first kind ***************



double arg1,res;



  if(arg>=3.0){

      arg1=3/arg;

      double f1,teta;

      teta=arg+

	   ((((0.00079824*arg1+0.00074348)*arg1-0.00637879)*arg1+

	       0.00005650)*arg1+0.12499612)*arg1-2.35619449;



      f1=((((0.00113653*arg1-0.00249511)*arg1+0.00017105)*arg1+

	  0.01659667)*arg1+0.00000156)*arg1+0.79788456;



      res=f1*cos(teta)/sqrt(arg);

      return res;

  }

  else {

     arg1=(arg/3)*(arg/3);

     res=arg*( 0.5+(((0.00443319*arg1-0.03954289)*arg1+

		      0.21093573)*arg1-0.56249985)*arg1  );

     return res;

  }}